package net.huashitong.ssydt.exam.entity.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import net.huashitong.ssydt.exam.entity.SsExamTestRecord;

import java.util.List;

/**
 * @author <a href="mailto:yhy23456@163.com">huiyang.yu</a>
 * @since 2017.08.28
 */
@ApiModel(value = "TestRecordVo", description = "记录对象")
public class TestRecordVo extends BaseRecord {

    private static final long serialVersionUID = -4091553315487284207L;
    @ApiModelProperty(value = "阶段数")
    private Integer stageNumber;//阶段数

    @ApiModelProperty(value = "选择题列表")
    private List<ExamQuestion> questions;

    public TestRecordVo(SsExamTestRecord record, List<ExamQuestion> questions) {
        this.setRecordId(record.getId());
        this.stageNumber = record.getStageNumber();
        this.setTestState(record.getTestState());
        this.setQuestionNumber(record.getQuestionNumber());
        this.setFinishNumber(record.getFinishNumber());
        this.setCorrectNumber(record.getCorrectNumber());
        this.setCorrectAvgRate(record.getCorrectAvgRate());
        this.setCoefficient(record.getCoefficient());
        this.setBeatRate(record.getBeatRate());
        this.setUserTime(record.getUserTime());
        this.setQuestions(questions);
    }

    public List<ExamQuestion> getQuestions() {
        return questions;
    }

    public void setQuestions(List<ExamQuestion> questions) {
        this.questions = questions;
    }

    public Integer getStageNumber() {
        return stageNumber;
    }

    public void setStageNumber(Integer stageNumber) {
        this.stageNumber = stageNumber;
    }


    /**
     * 选择题对象
     */
    @ApiModel(value = "ExamQuestion", description = "记录对象")
    public static class ExamQuestion extends BaseRecordQuestion {

        private static final long serialVersionUID = 4524297019626339566L;

        @ApiModelProperty(value = "练习记录id")
        private Long testQuestionId;//练习记录id

        public Long getTestQuestionId() {
            return testQuestionId;
        }

        public void setTestQuestionId(Long testQuestionId) {
            this.testQuestionId = testQuestionId;
        }


    }


}
